<h2>게시판 목록</h2>
<table class="list">
  <tr>
    <th>board name</th>
    <th>title </th>
    <th>manager</th>
    <th>enable</th>
    <th>posts</th>
    <th></th>
  </tr>
<% for board in @boards %>
  <tr>
    <td><%= link_to  board.board_name, :controller => 'board_posts' ,:action=> 'list' , :board_name => board.board_name %></td>
    <td><%= link_to  board.title, :controller => 'board_posts' ,:action=> 'list' , :board_name => board.board_name %></td>
    <td><%= link_to  board.user.name, :controller => 'board_posts' ,:action=> 'list' , :board_name => board.board_name %></td>
    <td><%= link_to  board.fl_enable, :controller => 'board_posts' ,:action=> 'list' , :board_name => board.board_name %></td>
    <td><%= link_to  board.board_post.count, :controller => 'board_posts' ,:action=> 'list' , :board_name => board.board_name %></td>
    <td><%= link_to 'Show', :action => 'show', :id => board %>
    <%
        if(board.user_id == session[:user_id])
    %>
    &nbsp;<%= link_to 'Edit', :action => 'edit', :id => board %>
    &nbsp;<%= link_to 'Destroy', { :action => 'destroy', :id => board }, :confirm => 'Are you sure?', :post => true %>
    <%
        end
    %>
    </td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @board_pages.current.previous } if @board_pages.current.previous %>
<%= link_to 'Next page', { :page => @board_pages.current.next } if @board_pages.current.next %> 

<br />
<div class="nav">
<%= link_to 'New board', :action => 'new' %>
</div>
